<?php

namespace Biz\service\brand;

use Biz\model\brand\Brand as mBrand;

class BrandTask
{
    /**
     * 新手任务
     * @param $uid
     * @return array
     */
    public static function newBieTask($uid)
    {
        $task = [
            'type' => 'newbie_task',
            'task_name' => '新手任务',
            'today_reward_value' => 0,
            'list' => []
        ];
        return $task;
    }

    /**
     * 成长任务
     * @param $uid
     * @return array
     */
    public static function growTask($uid)
    {
        $task = [
            'type' => 'level_task',
            'task_name' => '成长任务',
            'today_reward_value' => 0,
            'list' => [],
        ];
        return $task;
    }

    /**
     * 每日任务
     * @param $uid
     * @return array
     */
    public static function dailyTask($uid)
    {
        $task = [
            'type' => 'daily_task',
            'task_name' => '每日任务',
            'today_reward_value' => 0,
            'list' => [],
        ];
        return $task;
    }


    /**
     * 用户任务
     * @param $uid
     * @return array
     */
    public static function userTask($uid)
    {
        $task = [];
        $brandInfo = mBrand::getBrandInfoByUid($uid);
        if ($brandInfo['level'] == 0) {
            $task[] = self::newBieTask($uid);
            return $task;
        }
        $task[] = self::growTask($uid);
        $task[] = self::dailyTask($uid);
        return $task;
    }
}